CodeOrigin Home

Category

Software Engineering

6 articles

When Histories Diverge: Building a Three-Way Merge From the Diff Up

When Histories Diverge: Building a Three-Way Merge From the Diff Up

A merge conflict is not a failure of Git; it is the visible edge of an ambiguity that no tool can resolve for you. This article starts with the shortest-edit script behind a diff, derives the common-ancestor comparison that enables three-way merging, and builds a small merger that emits conflict markers.

Before the Abuse Arrives: A Rate-Limiter Ladder From Naive Counters to Token Buckets

Before the Abuse Arrives: A Rate-Limiter Ladder From Naive Counters to Token Buckets

Rate limiting is usually added after the first expensive surprise. This article starts with the naive counter, exposes its burst problem, and climbs through fixed windows, sliding logs, and token buckets with middleware code, representative benchmarks, and the distributed-systems caveats US teams should plan for in 2026.